<h1>Listing operations</h1>

<% link_to new_operation_path, :class => 'ui-state-default ui-corner-all dialog_link' do %>
	<span class="ui-icon ui-icon-plus"></span>New operation
<% end %>

<table>
  <tr class="ui-state-default">
    <th>Name</th>
    <th>Description</th>
    <th>Start date</th>
    <th>End date</th>
    <th>Status</th>
	<th></th>
	<th></th>
  </tr>

<% @operations.each do |operation| %>
  <tr>
    <td><%=h operation.name %></td>
    <td><%=h operation.description %></td>
    <td><%=h operation.start_date %></td>
    <td><%=h operation.end_date %></td>
    <td><%=h Operation::OPERATION_STATUS[operation.status] %></td>
    <td>
    	<% link_to operation, :class => "ui-state-default ui-corner-all dialog_link" do %>
			<span class="ui-icon ui-icon-search"></span>View
		<% end %>
    </td>
	<td>
		<% link_to operation, :confirm => 'Are you sure ?', :method => :delete, :class => "ui-state-error ui-corner-all dialog_link ui-state-hover" do %>
			<span class="ui-icon ui-icon-close"></span>Destroy
		<% end %>
	</td>
  </tr>
<% end %>
</table>